package com.ruoyi.process.utils;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.domain.Historyinfo;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JsonNode {
    private String jSonText;

    private String startRealName;

    public void setStartRealName(String startRealName) {
        this.startRealName = startRealName;
    }


//    public static void main2(String[] args) {
//        String strdata="{\"type\":\"ROOT\",\"class\":\"start\",\"content\":\"所有人\",\"name\":\"发起人\",\"desc\":\"所有人\",\"props\":{\"assignedUser\":[{\"type\":\"INITIATOR\",\"name\":\"所有人\"}],\"title\":\"发起人\",\"formOperates\":[{\"formId\":6},{\"formId\":7},{\"formId\":8}]},\"nodeId\":\"dFruITH\",\"id\":\"dFruITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"name\":\"刘世健\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"aWwuITH\",\"id\":\"aWwuITH\",\"prevId\":\"dFruITH\",\"parentId\":\"dFruITH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[单行输入框2 = 3] \\n\",\"content\":\"[单行输入框2 = 3] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":8,\"vModel\":\"dept_id\",\"vModelCode\":\"单行输入框2\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"3\"}}],\"initiator\":null,\"priority\":0,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\",\"isDefault\":false},\"nodeId\":\"KBzuITH\",\"id\":\"KBzuITH\",\"prevId\":\"OoyuITH\",\"parentId\":\"OoyuITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"卢可欣(15977726694)\",\"content\":\"卢可欣(15977726694)\",\"props\":{\"assignedUser\":[{\"name\":\"卢可欣\",\"id\":110,\"userId\":110,\"phonenumber\":\"15977726694\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"laAvITH\",\"id\":\"laAvITH\",\"prevId\":\"KBzuITH\",\"parentId\":\"KBzuITH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[单行输入框1 = 1] \\n\",\"content\":\"[单行输入框1 = 1] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":7,\"vModel\":\"form_id\",\"vModelCode\":\"单行输入框1\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"1\"}}],\"initiator\":null,\"priority\":0,\"isDefault\":false,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\"},\"nodeId\":\"bwBvITH\",\"id\":\"bwBvITH\",\"prevId\":\"cHCvITH\",\"parentId\":\"cHCvITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"李威(18677071867)\",\"content\":\"李威(18677071867)\",\"props\":{\"assignedUser\":[{\"name\":\"李威\",\"id\":111,\"userId\":111,\"phonenumber\":\"18677071867\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"GTDvITH\",\"id\":\"GTDvITH\",\"prevId\":\"bwBvITH\",\"parentId\":\"bwBvITH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"[单行输入框1 = 5] \\n\",\"content\":\"[单行输入框1 = 5] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[{\"formId\":7,\"vModel\":\"form_id\",\"vModelCode\":\"单行输入框1\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"5\"}}],\"initiator\":null,\"priority\":1,\"isDefault\":false,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\"},\"nodeId\":\"oDCvITH\",\"id\":\"oDCvITH\",\"prevId\":\"cHCvITH\",\"parentId\":\"cHCvITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"梁俊进(18407718370)\",\"content\":\"梁俊进(18407718370)\",\"props\":{\"assignedUser\":[{\"name\":\"梁俊进\",\"id\":114,\"userId\":114,\"phonenumber\":\"18407718370\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"QpSvITH\",\"id\":\"QpSvITH\",\"prevId\":\"oDCvITH\",\"parentId\":\"oDCvITH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件\",\"conditions\":[],\"initiator\":null,\"priority\":2,\"isDefault\":true},\"nodeId\":\"rbQvITH\",\"id\":\"rbQvITH\",\"prevId\":\"cHCvITH\",\"parentId\":\"cHCvITH\"}],\"nodeId\":\"cHCvITH\",\"id\":\"cHCvITH\",\"prevId\":\"laAvITH\",\"parentId\":\"laAvITH\"}}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[],\"initiator\":null,\"priority\":1,\"isDefault\":true},\"nodeId\":\"SCzuITH\",\"id\":\"SCzuITH\",\"prevId\":\"OoyuITH\",\"parentId\":\"OoyuITH\"}],\"nodeId\":\"OoyuITH\",\"id\":\"OoyuITH\",\"prevId\":\"aWwuITH\",\"parentId\":\"aWwuITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"生惠康(13737040197)\",\"content\":\"生惠康(13737040197)\",\"props\":{\"assignedUser\":[{\"name\":\"生惠康\",\"id\":121,\"userId\":121,\"phonenumber\":\"13737040197\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"TRHvITH\",\"id\":\"TRHvITH\",\"prevId\":\"OoyuITH\",\"parentId\":\"OoyuITH\"}}}}";
//        JsonNode jsonNode = new JsonNode(strdata);
//       List<Historyinfo> nextNodeList=new ArrayList<>();
//        Integer flag = 0;
//        jsonNode.findNodeById(nextNodeList,null, "aWwuITH",flag);
//        System.out.println(nextNodeList.toString());
//    }
//    public static void main1(String[] args) {
//        String strdata="{\"type\":\"ROOT\",\"class\":\"start\",\"content\":\"所有人\",\"name\":\"发起人\",\"desc\":\"所有人\",\"props\":{\"assignedUser\":[{\"type\":\"INITIATOR\",\"name\":\"所有人\"}],\"title\":\"发起人\",\"formOperates\":[{\"formId\":6},{\"formId\":7},{\"formId\":8}]},\"nodeId\":\"dFruITH\",\"id\":\"dFruITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"name\":\"刘世健\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"aWwuITH\",\"nodeid\":\"aWwuITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"aWwuITH\",\"id\":\"aWwuITH\",\"prevId\":\"dFruITH\",\"parentId\":\"dFruITH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[单行输入框2 = 3] \\n\",\"content\":\"[单行输入框2 = 3] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":8,\"vModel\":\"dept_id\",\"vModelCode\":\"单行输入框2\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"3\"}}],\"initiator\":null,\"priority\":0,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\",\"isDefault\":false},\"nodeId\":\"KBzuITH\",\"id\":\"KBzuITH\",\"prevId\":\"OoyuITH\",\"parentId\":\"OoyuITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"卢可欣(15977726694)\",\"content\":\"卢可欣(15977726694)\",\"props\":{\"assignedUser\":[{\"name\":\"卢可欣\",\"id\":110,\"userId\":110,\"phonenumber\":\"15977726694\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"laAvITH\",\"nodeid\":\"laAvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"laAvITH\",\"id\":\"laAvITH\",\"prevId\":\"KBzuITH\",\"parentId\":\"KBzuITH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[单行输入框1 = 1] \\n\",\"content\":\"[单行输入框1 = 1] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":7,\"vModel\":\"form_id\",\"vModelCode\":\"单行输入框1\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"1\"}}],\"initiator\":null,\"priority\":0,\"isDefault\":false,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\"},\"nodeId\":\"bwBvITH\",\"id\":\"bwBvITH\",\"prevId\":\"cHCvITH\",\"parentId\":\"cHCvITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"李威(18677071867)\",\"content\":\"李威(18677071867)\",\"props\":{\"assignedUser\":[{\"name\":\"李威\",\"id\":111,\"userId\":111,\"phonenumber\":\"18677071867\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"GTDvITH\",\"nodeid\":\"GTDvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"GTDvITH\",\"id\":\"GTDvITH\",\"prevId\":\"bwBvITH\",\"parentId\":\"bwBvITH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"[单行输入框1 = 5] \\n\",\"content\":\"[单行输入框1 = 5] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[{\"formId\":7,\"vModel\":\"form_id\",\"vModelCode\":\"单行输入框1\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"5\"}}],\"initiator\":null,\"priority\":1,\"isDefault\":false,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\"},\"nodeId\":\"oDCvITH\",\"id\":\"oDCvITH\",\"prevId\":\"cHCvITH\",\"parentId\":\"cHCvITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"梁俊进(18407718370)\",\"content\":\"梁俊进(18407718370)\",\"props\":{\"assignedUser\":[{\"name\":\"梁俊进\",\"id\":114,\"userId\":114,\"phonenumber\":\"18407718370\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"QpSvITH\",\"nodeid\":\"QpSvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"QpSvITH\",\"id\":\"QpSvITH\",\"prevId\":\"oDCvITH\",\"parentId\":\"oDCvITH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件\",\"conditions\":[],\"initiator\":null,\"priority\":2,\"isDefault\":true},\"nodeId\":\"rbQvITH\",\"id\":\"rbQvITH\",\"prevId\":\"cHCvITH\",\"parentId\":\"cHCvITH\"}],\"nodeId\":\"cHCvITH\",\"id\":\"cHCvITH\",\"prevId\":\"laAvITH\",\"parentId\":\"laAvITH\"}}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[],\"initiator\":null,\"priority\":1,\"isDefault\":true},\"nodeId\":\"SCzuITH\",\"id\":\"SCzuITH\",\"prevId\":\"OoyuITH\",\"parentId\":\"OoyuITH\"}],\"nodeId\":\"OoyuITH\",\"id\":\"OoyuITH\",\"prevId\":\"aWwuITH\",\"parentId\":\"aWwuITH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"生惠康(13737040197)\",\"content\":\"生惠康(13737040197)\",\"props\":{\"assignedUser\":[{\"name\":\"生惠康\",\"id\":121,\"userId\":121,\"phonenumber\":\"13737040197\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":7,\"formfId\":7,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框1\",\"fieldname\":\"form_id\",\"perm\":\"R\"},{\"nodeId\":\"TRHvITH\",\"nodeid\":\"TRHvITH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"单行输入框2\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"TRHvITH\",\"id\":\"TRHvITH\",\"prevId\":\"OoyuITH\",\"parentId\":\"OoyuITH\"}}}}";
//        JsonNode jsonNode = new JsonNode(strdata);
//        List<Historyinfo> nextNodeList=new ArrayList<>();
//        Integer flag = 0;
//        Map<String,Object> mapCond=new HashMap<>();
//        mapCond.put("dept_id",3);
//        mapCond.put("form_id",5);
//        jsonNode.findNodeById(nextNodeList,mapCond, "QpSvITH",flag);
//        System.out.println("result"+nextNodeList.toString());
//    }

    //    public static void main(String[] args) {
////        String strdata="{\"type\":\"ROOT\",\"class\":\"start\",\"content\":\"所有人\",\"name\":\"发起人\",\"desc\":\"所有人\",\"props\":{\"assignedUser\":[{\"type\":\"INITIATOR\",\"name\":\"所有人\"}],\"title\":\"发起人\",\"formOperates\":[{\"formId\":6}]},\"nodeId\":\"VLagZfH\",\"id\":\"VLagZfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"name\":\"刘世健\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"KlpgZfH\",\"nodeid\":\"KlpgZfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"KlpgZfH\",\"nodeid\":\"KlpgZfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"KlpgZfH\",\"id\":\"KlpgZfH\",\"prevId\":\"VLagZfH\",\"parentId\":\"VLagZfH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[手机号 = 3] \\n\",\"content\":\"[手机号 = 3] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":6,\"vModel\":\"test1\",\"vModelCode\":\"手机号\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"3\"}}],\"initiator\":null,\"priority\":0,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\",\"isDefault\":false},\"nodeId\":\"zvqgZfH\",\"id\":\"zvqgZfH\",\"prevId\":\"tyqgZfH\",\"parentId\":\"tyqgZfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"卢可欣(15977726694)\",\"content\":\"卢可欣(15977726694)\",\"props\":{\"assignedUser\":[{\"name\":\"卢可欣\",\"id\":110,\"userId\":110,\"phonenumber\":\"15977726694\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"RBFkZfH\",\"nodeid\":\"RBFkZfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"RBFkZfH\",\"nodeid\":\"RBFkZfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"RBFkZfH\",\"id\":\"RBFkZfH\",\"prevId\":\"zvqgZfH\",\"parentId\":\"zvqgZfH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[],\"initiator\":null,\"priority\":1,\"isDefault\":true},\"nodeId\":\"gxqgZfH\",\"id\":\"gxqgZfH\",\"prevId\":\"tyqgZfH\",\"parentId\":\"tyqgZfH\"}],\"nodeId\":\"tyqgZfH\",\"id\":\"tyqgZfH\",\"prevId\":\"KlpgZfH\",\"parentId\":\"KlpgZfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"文峰(15977790608)\",\"content\":\"文峰(15977790608)\",\"props\":{\"assignedUser\":[{\"name\":\"文峰\",\"id\":122,\"userId\":122,\"phonenumber\":\"15977790608\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"vdQkZfH\",\"nodeid\":\"vdQkZfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"vdQkZfH\",\"nodeid\":\"vdQkZfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"vdQkZfH\",\"id\":\"vdQkZfH\",\"prevId\":\"tyqgZfH\",\"parentId\":\"tyqgZfH\"}}}}";
////        String strdata="{\"type\":\"ROOT\",\"class\":\"start\",\"content\":\"所有人\",\"name\":\"发起人\",\"desc\":\"所有人\",\"props\":{\"assignedUser\":[{\"type\":\"INITIATOR\",\"name\":\"所有人\"}],\"title\":\"发起人\",\"formOperates\":[{\"formId\":6}]},\"nodeId\":\"VKHhhfH\",\"id\":\"VKHhhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"name\":\"刘世健\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"WHXhhfH\",\"nodeid\":\"WHXhhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"WHXhhfH\",\"nodeid\":\"WHXhhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"WHXhhfH\",\"id\":\"WHXhhfH\",\"prevId\":\"VKHhhfH\",\"parentId\":\"VKHhhfH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[手机号 = 1] \\n\",\"content\":\"[手机号 = 1] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":6,\"vModel\":\"test1\",\"vModelCode\":\"手机号\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"1\"}}],\"initiator\":null,\"priority\":0,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\",\"isDefault\":false},\"nodeId\":\"koahhfH\",\"id\":\"koahhfH\",\"prevId\":\"GwahhfH\",\"parentId\":\"GwahhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"李威(18677071867)\",\"content\":\"李威(18677071867)\",\"props\":{\"assignedUser\":[{\"name\":\"李威\",\"id\":111,\"userId\":111,\"phonenumber\":\"18677071867\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"yqohhfH\",\"nodeid\":\"yqohhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"yqohhfH\",\"nodeid\":\"yqohhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"yqohhfH\",\"id\":\"yqohhfH\",\"prevId\":\"koahhfH\",\"parentId\":\"koahhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"文峰(15977790608)\",\"content\":\"文峰(15977790608)\",\"props\":{\"assignedUser\":[{\"name\":\"文峰\",\"id\":122,\"userId\":122,\"phonenumber\":\"15977790608\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"QpBihfH\",\"nodeid\":\"QpBihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"QpBihfH\",\"nodeid\":\"QpBihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"QpBihfH\",\"id\":\"QpBihfH\",\"prevId\":\"yqohhfH\",\"parentId\":\"yqohhfH\"},\"branchs\":[]}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[],\"initiator\":null,\"priority\":1,\"isDefault\":true},\"nodeId\":\"mkahhfH\",\"id\":\"mkahhfH\",\"prevId\":\"GwahhfH\",\"parentId\":\"GwahhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"生惠康(13737040197)\",\"content\":\"生惠康(13737040197)\",\"props\":{\"assignedUser\":[{\"name\":\"生惠康\",\"id\":121,\"userId\":121,\"phonenumber\":\"13737040197\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"FaCihfH\",\"nodeid\":\"FaCihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"FaCihfH\",\"nodeid\":\"FaCihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"FaCihfH\",\"id\":\"FaCihfH\",\"prevId\":\"mkahhfH\",\"parentId\":\"mkahhfH\"}}],\"nodeId\":\"GwahhfH\",\"id\":\"GwahhfH\",\"prevId\":\"WHXhhfH\",\"parentId\":\"WHXhhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"黄昭凯(18172004739)\",\"content\":\"黄昭凯(18172004739)\",\"props\":{\"assignedUser\":[{\"name\":\"黄昭凯\",\"id\":124,\"userId\":124,\"phonenumber\":\"18172004739\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"zrDihfH\",\"nodeid\":\"zrDihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"zrDihfH\",\"nodeid\":\"zrDihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"zrDihfH\",\"id\":\"zrDihfH\",\"prevId\":\"GwahhfH\",\"parentId\":\"GwahhfH\"}}}}";
//        String strdata="{\"type\":\"ROOT\",\"class\":\"start\",\"content\":\"所有人\",\"name\":\"发起人\",\"desc\":\"所有人\",\"props\":{\"assignedUser\":[{\"type\":\"INITIATOR\",\"name\":\"所有人\"}],\"title\":\"发起人\",\"formOperates\":[{\"formId\":6}]},\"nodeId\":\"VKHhhfH\",\"id\":\"VKHhhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"type\":\"test1\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"WHXhhfH\",\"nodeid\":\"WHXhhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"WHXhhfH\",\"nodeid\":\"WHXhhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"WHXhhfH\",\"id\":\"WHXhhfH\",\"prevId\":\"VKHhhfH\",\"parentId\":\"VKHhhfH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[手机号 = 1] \\n\",\"content\":\"[手机号 = 1] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":6,\"vModel\":\"test1\",\"vModelCode\":\"手机号\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"1\"}}],\"initiator\":null,\"priority\":0,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\",\"isDefault\":false},\"nodeId\":\"koahhfH\",\"id\":\"koahhfH\",\"prevId\":\"GwahhfH\",\"parentId\":\"GwahhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"李威(18677071867)\",\"content\":\"李威(18677071867)\",\"props\":{\"assignedUser\":[{\"name\":\"李威\",\"id\":111,\"userId\":111,\"phonenumber\":\"18677071867\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"yqohhfH\",\"nodeid\":\"yqohhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"yqohhfH\",\"nodeid\":\"yqohhfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"yqohhfH\",\"id\":\"yqohhfH\",\"prevId\":\"koahhfH\",\"parentId\":\"koahhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"文峰(15977790608)\",\"content\":\"文峰(15977790608)\",\"props\":{\"assignedUser\":[{\"name\":\"文峰\",\"id\":122,\"userId\":122,\"phonenumber\":\"15977790608\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"QpBihfH\",\"nodeid\":\"QpBihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"QpBihfH\",\"nodeid\":\"QpBihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"QpBihfH\",\"id\":\"QpBihfH\",\"prevId\":\"yqohhfH\",\"parentId\":\"yqohhfH\"},\"branchs\":[]}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[],\"initiator\":null,\"priority\":1,\"isDefault\":true},\"nodeId\":\"mkahhfH\",\"id\":\"mkahhfH\",\"prevId\":\"GwahhfH\",\"parentId\":\"GwahhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"生惠康(13737040197)\",\"content\":\"生惠康(13737040197)\",\"props\":{\"assignedUser\":[{\"name\":\"生惠康\",\"id\":121,\"userId\":121,\"phonenumber\":\"13737040197\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"FaCihfH\",\"nodeid\":\"FaCihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"FaCihfH\",\"nodeid\":\"FaCihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"FaCihfH\",\"id\":\"FaCihfH\",\"prevId\":\"mkahhfH\",\"parentId\":\"mkahhfH\"}}],\"nodeId\":\"GwahhfH\",\"id\":\"GwahhfH\",\"prevId\":\"WHXhhfH\",\"parentId\":\"WHXhhfH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"黄昭凯(18172004739)\",\"content\":\"黄昭凯(18172004739)\",\"props\":{\"assignedUser\":[{\"name\":\"黄昭凯\",\"id\":124,\"userId\":124,\"phonenumber\":\"18172004739\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"zrDihfH\",\"nodeid\":\"zrDihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"zrDihfH\",\"nodeid\":\"zrDihfH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"zrDihfH\",\"id\":\"zrDihfH\",\"prevId\":\"GwahhfH\",\"parentId\":\"GwahhfH\"}}}}";
//
//        System.out.println("start"+strdata);
//        JsonNode jsonNode = new JsonNode(strdata);
//        List<Historyinfo> nextNodeList=new ArrayList<>();
//        Integer flag = 0; //2代表没有走过流程
//        Map<String,Object> mapCond=new HashMap<>();
//        Map<String,Object> varList=new HashMap<>();
////        varList.put("test1","张三");
//
////         mapCond.put("test1",2);
//        jsonNode.findNodeById(nextNodeList,mapCond, "FaCihfH",flag,varList);
//        System.out.println("result"+nextNodeList.toString());
//    }
    public static void main3(String[] args) {
        String strdata = "{\"type\":\"ROOT\",\"class\":\"start\",\"content\":\"所有人\",\"name\":\"发起人\",\"desc\":\"所有人\",\"props\":{\"assignedUser\":[{\"type\":\"INITIATOR\",\"name\":\"所有人\"}],\"title\":\"发起人\",\"formOperates\":[{\"formId\":6},{\"formId\":8}]},\"nodeId\":\"IXherTH\",\"id\":\"IXherTH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"name\":\"刘世健\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"WgDfrTH\",\"nodeid\":\"WgDfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"WgDfrTH\",\"nodeid\":\"WgDfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"WgDfrTH\",\"id\":\"WgDfrTH\",\"prevId\":\"IXherTH\",\"parentId\":\"IXherTH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"刘世健(13707886262)\",\"content\":\"刘世健(13707886262)\",\"props\":{\"assignedUser\":[{\"name\":\"刘世健\",\"id\":109,\"userId\":109,\"phonenumber\":\"13707886262\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"DLFfrTH\",\"nodeid\":\"DLFfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"DLFfrTH\",\"nodeid\":\"DLFfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"DLFfrTH\",\"id\":\"DLFfrTH\",\"prevId\":\"WgDfrTH\",\"parentId\":\"WgDfrTH\",\"children\":{\"type\":\"CONDITIONS\",\"class\":\"conditions\",\"name\":\"条件分支\",\"desc\":\"请设置条件\",\"content\":\"请设置条件\",\"branchs\":[{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件1\",\"desc\":\"[部门 = 2] \\n\",\"content\":\"[部门 = 2] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件1\",\"conditions\":[{\"formId\":8,\"vModel\":\"dept_id\",\"vModelCode\":\"部门\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"2\"}}],\"initiator\":null,\"priority\":0,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\",\"isDefault\":false},\"nodeId\":\"TPGfrTH\",\"id\":\"TPGfrTH\",\"prevId\":\"oMGfrTH\",\"parentId\":\"oMGfrTH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"卢可欣(15977726694)\",\"content\":\"卢可欣(15977726694)\",\"props\":{\"assignedUser\":[{\"name\":\"卢可欣\",\"id\":110,\"userId\":110,\"phonenumber\":\"15977726694\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"rFYfrTH\",\"nodeid\":\"rFYfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"rFYfrTH\",\"nodeid\":\"rFYfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"rFYfrTH\",\"id\":\"rFYfrTH\",\"prevId\":\"TPGfrTH\",\"parentId\":\"TPGfrTH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件2\",\"desc\":\"[部门 = 1] \\n\",\"content\":\"[部门 = 1] \\n\",\"branchs\":[],\"props\":{\"title\":\"条件2\",\"conditions\":[{\"formId\":8,\"vModel\":\"dept_id\",\"vModelCode\":\"部门\",\"conditionValue\":{\"type\":\"eq\",\"value\":\"1\"}}],\"initiator\":null,\"priority\":1,\"isDefault\":false,\"nobody\":{\"handler\":\"PASS\"},\"conditionalsType\":\"\"},\"nodeId\":\"xTGfrTH\",\"id\":\"xTGfrTH\",\"prevId\":\"oMGfrTH\",\"parentId\":\"oMGfrTH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"李威(18677071867)\",\"content\":\"李威(18677071867)\",\"props\":{\"assignedUser\":[{\"name\":\"李威\",\"id\":111,\"userId\":111,\"phonenumber\":\"18677071867\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"NSZfrTH\",\"nodeid\":\"NSZfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"NSZfrTH\",\"nodeid\":\"NSZfrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"NSZfrTH\",\"id\":\"NSZfrTH\",\"prevId\":\"xTGfrTH\",\"parentId\":\"xTGfrTH\"}},{\"type\":\"CONDITION\",\"class\":\"condition\",\"name\":\"条件\",\"desc\":\"其他情况进入此流程\",\"content\":\"其他情况进入此流程\",\"branchs\":[],\"props\":{\"title\":\"条件\",\"conditions\":[],\"initiator\":null,\"priority\":2,\"isDefault\":true},\"nodeId\":\"tTRcRUH\",\"id\":\"tTRcRUH\",\"prevId\":\"oMGfrTH\",\"parentId\":\"oMGfrTH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"黄昭凯(18172004739)\",\"content\":\"黄昭凯(18172004739)\",\"props\":{\"assignedUser\":[{\"name\":\"黄昭凯\",\"id\":124,\"userId\":124,\"phonenumber\":\"18172004739\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"InIgRUH\",\"nodeid\":\"InIgRUH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"InIgRUH\",\"nodeid\":\"InIgRUH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"部门\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"InIgRUH\",\"nodeid\":\"InIgRUH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"test1\",\"perm\":\"R\"},{\"nodeId\":\"InIgRUH\",\"nodeid\":\"InIgRUH\",\"formId\":8,\"formfId\":8,\"required\":false,\"tag\":\"el-input\",\"label\":\"部门\",\"fieldname\":\"dept_id\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"InIgRUH\",\"id\":\"InIgRUH\",\"prevId\":\"tTRcRUH\",\"parentId\":\"tTRcRUH\"}}],\"nodeId\":\"oMGfrTH\",\"id\":\"oMGfrTH\",\"prevId\":\"DLFfrTH\",\"parentId\":\"DLFfrTH\",\"children\":{\"type\":\"APPROVAL\",\"class\":\"approver\",\"name\":\"审批人\",\"desc\":\"玉盛杭(18277181460)\",\"content\":\"玉盛杭(18277181460)\",\"props\":{\"assignedUser\":[{\"name\":\"玉盛杭\",\"id\":123,\"userId\":123,\"phonenumber\":\"18277181460\"}],\"mode\":\"\",\"nobady\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"refuse\":{\"type\":\"TO_END\",\"target\":\"\"},\"title\":\"审批人\",\"nobody\":{\"handler\":\"PASS\",\"assignedUser\":[]},\"formPerms\":[{\"nodeId\":\"HXffrTH\",\"nodeid\":\"HXffrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"approvers\":[],\"assigneeType\":\"ASSIGN_USER\",\"jumpByDeptLevel\":\"\",\"deptLevel\":\"\",\"formuser\":[],\"skipNodeId\":false,\"childProcessList\":[],\"formOperates\":[{\"nodeId\":\"HXffrTH\",\"nodeid\":\"HXffrTH\",\"formId\":6,\"formfId\":6,\"required\":true,\"tag\":\"el-input\",\"label\":\"手机号\",\"fieldname\":\"mobile\",\"perm\":\"R\"}],\"counterSign\":true,\"optionalMultiUser\":false,\"optionalRange\":\"ALL\",\"ifAssign\":false,\"seal\":false,\"ifSkipGrade\":0,\"nobodyType\":\"PASS\",\"nobodyAssignedUser\":[],\"subpfid\":\"\"},\"nodeId\":\"HXffrTH\",\"id\":\"HXffrTH\",\"prevId\":\"oMGfrTH\",\"parentId\":\"oMGfrTH\"}}}}}";
        JsonNode jsonNode = new JsonNode(strdata);
        List<Historyinfo> nextNodeList = new ArrayList<>();
        Map<String, Object> varList = new HashMap<>();
        Integer flag = 2; //2代表没有走过流程
        Map<String, Object> mapCond = new HashMap<>();
        mapCond.put("dept_id", 5);
        jsonNode.findNodeById(nextNodeList, mapCond, "NSZfrTH1", flag, varList);
        System.out.println("result" + nextNodeList.toString());
    }

    /**
     * @param jSonText 流程图的json格式
     */
    public JsonNode(String jSonText) {
        this.jSonText = jSonText;
    }

    /**
     * 根据节点id查找以下的节点
     * 如果没有判断条件传入时
     * 根据流程id去查找，遇到判断条件节点显示分支
     * 如果有判断条件传入时
     * 满足条件就显示此条分支
     *
     * @param varMap 变量集合，对应的值为字符串
     * @param nodeId
     * @return
     */
    public Integer findNodeById(List<Historyinfo> nextNodeList, Map<String, Object> varMap, String nodeId, Integer flag, Map<String, Object> varList) {
        JSONObject jsonObject = JSONObject.parseObject(this.jSonText);
        String tmpnodeId = jsonObject.getString("nodeId");
        String strProp = jsonObject.getString("props");
        if (strProp != null) {
            JSONObject jsonProp = JSONObject.parseObject(strProp);
            String assignUser = jsonProp.getString("assignedUser");
            String assigneeType=jsonProp.getString("assigneeType");
            String nodeType = jsonObject.getString("type");
            Historyinfo historyInfo = new Historyinfo();
            historyInfo.setNodeid(tmpnodeId);
            historyInfo.setFlag(flag);
            if (nodeType.equals("ROOT")) {
                historyInfo.setRealname("发起人");
                historyInfo.setTaskname("发起人");
                historyInfo.setNtype(1);
                nextNodeList.add(historyInfo);
            } else {
                if (!nodeType.equals("CONDITIONS")) {
                    if (assignUser != null && !assignUser.equals("[]")) {

                        JSONArray arrAssignUser = JSONArray.parseArray(assignUser);
                        if (arrAssignUser.size() > 0) {
                            //变量名是不是等于变量，如果是就替换
                            String realName = "";
                            JSONObject tmpJsonObj = arrAssignUser.getJSONObject(0);
                            String propType = tmpJsonObj.getString("type");
                            if (propType != null && !propType.equals("")) {
                                if (propType.equals("director")) {
//                                    Long userId = SecurityUtils.getUserId();
//                                    List<Map<String, Object>> directlist = this.tableformMapper.getdatatblwidthcond("DISTINCT user_id,nick_name as nickName", "sys_user", "user_id in (select leader_id from sys_dept a where dept_id in (select dept_id from sys_user where user_id=1))");
//                                    if (directlist != null && directlist.size() > 0) {
//                                        realName = String.valueOf(directlist.get(0).get("nickName"));
//                                    }
                                }

                            } else {
                                String tmpRealName = (String) varList.get(propType);
                                if (tmpRealName != null && !tmpRealName.equals("")) {
                                    realName = tmpRealName;
                                } else {
                                    if("SELF".equals(assigneeType)){
                                        realName = this.startRealName;
                                    }else{
                                        for (Object assignUserObj : arrAssignUser) {
                                            JSONObject jsonObj = (JSONObject) assignUserObj;
                                            realName = realName + "," + jsonObj.getString("name");
                                        }
                                        if (realName.length() > 0) {
                                            realName = realName.substring(1);
                                        }
                                   }


                                }
                            }
                            historyInfo.setRealname(realName);
//                            JSONObject  assignUserObj = arrAssignUser.getJSONObject(0);
//                            historyInfo.setAssignee(realName);
                        }

//                        historyInfo.setRealname(assignUserObj.getString("name"));
                        historyInfo.setTaskname(String.valueOf(jsonObject.get("name")));
                        historyInfo.setNtype(1);
                    } else {
                        historyInfo.setTaskname(String.valueOf(jsonObject.get("name")));
                        String nobody = jsonProp.getString("nobody");

                        //查找下一层，如果找到下一层后就指定人
                        JSONObject tmpjsonProp = JSONObject.parseObject(nobody);
                        if (tmpjsonProp != null) {
                            String handler = String.valueOf(tmpjsonProp.get("handler"));
                            if (handler != null) {
                                if (handler.equals("TO_USER")) {
                                    String noAssignUser = String.valueOf(tmpjsonProp.get("assignedUser"));
                                    JSONArray arrNoAssign = JSONArray.parse(noAssignUser);
                                    JSONObject noAssignUserObj = arrNoAssign.getJSONObject(0);
                                    historyInfo.setRealname(noAssignUserObj.getString("name"));
                                }
                            }
                        }

                    }

                    if (historyInfo.getTaskname() != null && !historyInfo.getTaskname().equals("null")) {
                        nextNodeList.add(historyInfo);
                    }
                }
            }
        }

        String strChildren = jsonObject.getString("children");
        if (strChildren != null) {
            JSONObject childNode = JSONObject.parseObject(strChildren);
            String strBranch = childNode.getString("branchs");
            if (strBranch != null) {
                int tmpflag = 0;
                if (varMap != null && varMap.size() > 0) {//有判断条件传入
                    tmpflag = this.findBrandches(nextNodeList, strBranch, varMap, nodeId, flag, varList);
                } else {
                    //节点id查找，如果找到，显示当前条，如果没有找到就显示条件
                    tmpflag = this.findBrandcheByTaskId(nextNodeList, strBranch, varMap, nodeId, flag, varList);
                    if (tmpflag == 0) {
                        Historyinfo historyInfo = new Historyinfo();
                        historyInfo.setNodeid("");
                        historyInfo.setRealname("分支条件");
                        historyInfo.setFlag(flag);
                        nextNodeList.add(historyInfo);
                    }
                }

            }

            JsonNode subNode = new JsonNode(strChildren);
//            subNode.setTableformMapper(this.tableformMapper);
            subNode.setStartRealName(this.startRealName);
            if (tmpnodeId.equals(nodeId)) {
                flag = 1;
            }
            subNode.findNodeById(nextNodeList, varMap, nodeId, flag, varList);
        }
        return flag;
    }

    /**
     * 根据节点查找，如果找到就按找到的分支进行显示
     *
     * @param nextNodeList
     * @param strbrand
     * @param varMap
     * @param nodeId
     * @param flag
     * @return
     */
    private Integer findBrandcheByTaskId(List<Historyinfo> nextNodeList, String strbrand, Map<String, Object> varMap, String nodeId, Integer flag, Map<String, Object> varList) {
        JSONArray branchList = JSONArray.parseArray(strbrand);
        String otherBranch = null;
        int isexisting = 0;
        JSONObject curBranches = null;
        for (Object branchObj : branchList) {
            JSONObject branchJson = JSONObject.parseObject(branchObj.toString());
            if (StringUtils.isNotEmpty(nodeId) && branchObj.toString().contains("\"" + nodeId + "\"")) {
                curBranches = branchJson;
                isexisting = 1;
                break;
            }

        }

        //如果找到加载到集合中
        if (isexisting == 1) {

            String subbranchJson = curBranches.getString("children");
            JsonNode jsonNode1 = new JsonNode(subbranchJson);
            jsonNode1.findNodeById(nextNodeList, varMap, nodeId, flag, varList);

        }

        return isexisting;
    }

    /**
     * 分支查找
     *
     * @param strbrand 分支列表
     */
    public Integer findBrandches(List<Historyinfo> nextNodeList, String strbrand, Map<String, Object> varMap, String nodeId, Integer flag, Map<String, Object> varList) {
        JSONArray branchList = JSONArray.parseArray(strbrand);
        String otherBranch = null;
        int isexisting = 0;
        for (Object branchObj : branchList) {
            //找到对应的分支
            JSONObject branchJson = JSONObject.parseObject(branchObj.toString());
            String strProp = branchJson.getString("props");

            JSONObject propBranch = JSONObject.parseObject(strProp);
            if (propBranch.getString("conditions") != null && propBranch.getString("conditions").length() > 0) {
                otherBranch = String.valueOf(branchObj);
            }

            boolean branchflag = this.judgeBranch(strProp, varMap, nodeId, flag);
            if (branchflag) {
                isexisting = 1;
                String subbranchJson = branchJson.getString("children");
                JsonNode jsonNode1 = new JsonNode(subbranchJson);

                flag = jsonNode1.findNodeById(nextNodeList, varMap, nodeId, flag, varList);

            }
        }
        //        其他流程的处理
        if (otherBranch != null && isexisting == 0) {
            if (otherBranch.contains("children")) {
                JsonNode subNode = new JsonNode(otherBranch);
                flag = subNode.findNodeById(nextNodeList, varMap, nodeId, flag, varList);
            }
        }

        return flag;
    }


    /**
     * 条件判断
     *
     * @param strProp 条件字符串
     * @return
     */
    public boolean judgeBranch(String strProp, Map<String, Object> condMap, String nodeId, Integer flag) {
        boolean flagRet = false;
        if (strProp != null) {
            JSONObject jsonProp = JSONObject.parseObject(strProp);
            JSONArray jsonArray = jsonProp.getJSONArray("conditions");
            //条件数据
            if (jsonArray != null && jsonArray.size() > 0) {
                JSONObject jsonObj = jsonArray.getJSONObject(0);
                String fieldName = jsonObj.getString("vModel");
                //从condMap中取值，如果有相同变量的时候，进行对值进行做一下比较判断
                if (condMap.get(fieldName) != null) {
                    String condValue = condMap.get(fieldName).toString();
                    if (condValue != null && !condValue.equals("")) {
                        String fieldValue = jsonObj.getString("conditionValue");
                        JSONObject condList = JSONObject.parseObject(fieldValue);
                        if (condList != null) {
                            String operator = condList.getString("type");//操作符 eq neq gt lt gte lte
                            if (operator.equals("eq")) {
                                if (condValue.equals(condList.getString("value"))) {
                                    flagRet = true;
                                }
                            }
                            if (operator.equals("neq")) {
                                if (!condValue.equals(condList.getString("value"))) {
                                    flagRet = true;
                                }

                            }
                            if (operator.equals("gt")) {
                                if (condValue.compareTo(condList.getString("value")) > 0) {
                                    flagRet = true;
                                }
                            }
                            if (operator.equals("lt")) {
                                if (condValue.compareTo(condList.getString("value")) < 0) {
                                    flagRet = true;
                                }
                            }
                            if (operator.equals("gte")) {
                                if (condValue.compareTo(condList.getString("value")) >= 0) {
                                }
                                if (operator.equals("lte")) {
                                    if (condValue.compareTo(condList.getString("value")) <= 0) {
                                        flagRet = true;
                                    }
                                }

                            }
                        }

                    }

                }

            }
        }
        return flagRet;
    }


    public void getNodeInfo(String jSonText) {
        JSONObject jsonObject = JSONObject.parseObject(jSonText);
        System.out.println(jsonObject.get("nodeId"));
        //判断下一个节点存不存在

        String nextNodeInfo = jsonObject.getString(jSonText);


    }

}
